#ifndef CPPITEM_H
#define CPPITEM_H

#include <QQuickPaintedItem>

//测试用
class CppItem : public QQuickPaintedItem
{
    Q_OBJECT
    Q_PROPERTY(QString name READ getName WRITE setName NOTIFY nameChanged)
public:
    explicit CppItem(QQuickItem *parent = nullptr);

    void paint(QPainter *painter) override;

    QString getName() const {return name;}
    void setName(const QString &str) { name=str; emit nameChanged(); }

signals:
    void nameChanged();

private:
    QString name;
};

#endif // CPPITEM_H
